package day03;

public class IfElseIfDemo {
    public static void main(String[] args) {
        int price = (int)(Math.random()*10000);
        System.out.println("总消费为："+price+"元。");
        if(price>=8000){
            System.out.print("打5折！");
            price *= 0.5;
        } else if (price>=6000) {
            System.out.println("打6折！");
            price *= 0.6;
        } else if (price>=4000) {
            System.out.println("打7折！");
            price *= 0.7;
        } else if (price>=2000) {
            System.out.println("打8折！");
            price *= 0.8;
        } else {
            System.out.println("打九折！");
            price *= 0.9;
        }
        System.out.println("消费金额为："+price+"元。");
    }
}
